<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
    <head>
	    <title></title>
	    <meta charset="utf-8">
	    <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
	    <link rel="stylesheet" href="../../skin/base.css">
	    <link rel="stylesheet" href="css/index.css">
		<script src="../../js/config.js"></script>
	    <script src="../../js/zy_control.js"></script>
	    <script src="../../js/zy_click.js"></script>
	</head>
	<body>
		<div id="main" class="loading"></div>
	</body>
	<script>
	zy_init();
	function query(){
		uexWindow.open('apps_bus_search','0','search.html','2','', '',0);
	}
	function jump(id,title){
		localStorage['apps_bus_id']=id;
		localStorage['apps_bus_title']=title;
		uexWindow.open('apps_bus_item','0','item.html','2','', '',0);
	}
	function getMain(t){
		var url = app_path+'index.php?m=iappBus&c=app&a=lists';
		uexXmlHttpMgr.open(t,'post',url,"8000");
		uexXmlHttpMgr.send(t);
	}
	window.uexOnload=function(type){
		if (!type){

			uexWindow.setBounce("1");
			uexWindow.setBounceParams("0",'{"imagePath":"res://loading.png","textColor":"#666","levelText":"","pullToReloadText":"拖动刷新","releaseToReloadText":"释放刷新","loadingText":"加载中，请稍等"}');
            uexWindow.showBounceView("0","#f3f3f3","1");
            uexWindow.notifyBounceEvent("0","1");
			
			uexWindow.onBounceStateChange=function(t,s){
	　　　　　　	if(t=="0"){
	　　　　　　　　	if(s=="2"){
						getMain(t);
					}
	　　　　　　	}
	　　　　	}
			
			uexXmlHttpMgr.onData = function(opId, status, data){
				if(status==1){
					if(opId<1){					
						uexWindow.setBounceParams("0",'{"imagePath":"res://loading.png","textColor":"#666","levelText":"上次更新：'+Now()+'","pullToReloadText":"拖动刷新","releaseToReloadText":"释放刷新","loadingText":"加载中，请稍等"}');
					}
					uexXmlHttpMgr.close(opId);
					uexWindow.resetBounceView(opId);
					data = JSON.parse(data);
					var mainHtml='';
					for(var i=0;i<data.length;i++){
						mainHtml+='<section><menu ontouchstart="zy_touch(\'down\')" onclick="jump('+data[i]['busid']+',\''+data[i]['title']+'\');"><strong>'+data[i]['title']+'</strong><var></var></menu></section>';
					}
					$$('main').className='';
					$$('main').innerHTML=mainHtml;
					
					
				}else if(status ==-1) {//加载失败
					uexXmlHttpMgr.close(opId);
					uexWindow.resetBounceView(opId);
					uexWindow.toast("0","5",'加载失败',1000);
				}
			}
			
			getMain(-1);
		}
	}
	</script>
</html>